package xyz.jcat.sca.example.lagou.deliver.web.controller;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import xyz.jcat.sca.example.lagou.common.api.IResumeService;
import xyz.jcat.sca.example.lagou.deliver.feign.ResumeFeignClient;
import xyz.jcat.common.web.Resp;

@RestController
public class DeliverController {

    @Autowired
    private ResumeFeignClient resumeFeignClient;
    @DubboReference
    private IResumeService resumeService;

    @GetMapping("/user/{userId}/status")
    public Resp checkUserResumeStatus(@PathVariable Long userId) {
        return resumeFeignClient.getUserResumeStatus(userId);
    }

    @GetMapping("/user/{userId}/resume")
    public Resp getUserResume(@PathVariable Long userId) {
        return Resp.ok(resumeService.getUserResume(userId));
    }

}
